import React from 'react'
import { connect } from 'react-redux'
import { RecommendItem } from '../style'

class Recommend extends React.PureComponent {
  render () {
    const { list } = this.props
    return (
      <div>
        {
          list.map((item) => (
            <RecommendItem key={item.get('id')} imgUrl={item.get('imgUrl')}/>
          ))
        }
      </div>
    )
  }
}

const mapStoreToProps = (state) => ({
  list: state.getIn(['home', 'recommendList'])
})
export default connect(mapStoreToProps, null)(Recommend)